import { ready } from './utils'
// import { toast } from 'kuan-request'

export default async () => {
  await ready()
  return new Promise((resolve, reject) => {
    AlipayJSBridge.call(
      'getCurrentLocation',
      { bizType: 'COMMON_CONFIG', requestType: 1 },
      result => {
        if (result.error) {
          return reject(result.errorMessage)
        }
        resolve(result)
      }
    )
  })
}
